package com.googlecode.tracey.headers;

import com.googlecode.tracey.id.TraceyId;

import static com.googlecode.tracey.id.TraceyIdValue.traceyIdValue;

public class Headers {
    public static final String TRACEY_ID_HEADER_NAME = "tracey-id";
    public static final String MESSAGE_ID = "Message-Id";
    public static final String FROM = "From";
    public static final String TO = "To";


    public static void scopedSet(String headerValue, Runnable whatToDo) {
        try {
            TraceyId.set(traceyIdValue(headerValue));
            whatToDo.run();
        } finally {
            TraceyId.clear();
        }
    }
}
